package com.dy.common.utils;

import com.alibaba.ttl.TransmittableThreadLocal;
import com.dy.common.pojo.User;

public class BaseContext {

    public static TransmittableThreadLocal<User> threadLocal = new TransmittableThreadLocal<>();

    public static void setCurrentUser(User user) {
        threadLocal.set(user);
    }

    public static User getCurrentUser() {
        return threadLocal.get();
    }

    public static void removeCurrentUser() {

        threadLocal.remove();
    }

}
